const HOST = 'http://localhost:3001';
export async function get(url: string) {
    console.log(`${HOST}${url}`);
    const res = await fetch(`${HOST}${url}`);
    const data = res.json();
    return data;
}

export async function post(url: string, body: any) {
    const res = await fetch(`${HOST}${url}`, {method: 'POST', body: JSON.stringify(body)});
    const data = res.json();
    return data;
}